#include<stdio.h>
struct queue
{
	int d[100];
	int h;
	int t;
};
int main()
{
	struct queue q;
	int i;
	q.h = 0;
	q.t = 0;
	for (i = 1; i <= 9; i++)
	{
		scanf_s("%d", &q.d[q.t]);
		q.t++;
	}
	while (q.h < q.t)
	{
		printf("%d ", q.d[q.h]);
		q.h++;
		q.d[q.t] =q.d[q.h];
		q.t++;
		q.h++;
	}
	return 0;
	
}